package com.study.sequence.web;

import com.study.sequence.service.ISequenceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by 张波 on 2020/5/24.
 */
@Slf4j
@RestController
public class TestSequenceController {

    @Autowired
    private ISequenceService sequenceService;

    @GetMapping("/sequence/{businesskey}")
    public Object getSequence(@PathVariable("businesskey") String businesskey) {
        String sequence = sequenceService.getSequence(businesskey);
        log.info("businessKey：{},本次生成sequence:{}", businesskey, sequence);
        return sequence;
    }
}
